class Person: def __init__(self,n,c): self.name=n self.city=c def showData(self): print("Name is",self.name) print("City is",self.city) class Employee: def __init__(self,s,a): self.salary=s self.advance=a def showData(self): print("Salary is",self.salary) print("Advance is",self.advance) def payment(self): p=self.salary-self.advance print("Payment is",p) class Programmer(Person,Employee): def __init__(self,n,c,s,a,*langs): Person.__init__(self,n,c) Employee.__init__(self,s,a) self.languages=langs def showData(self): Person.showData(self) Employee.showData(self) print("Languages",self.languages) a=Programmer("Raj Rathi","Nagpur",45500,5000,"C","C++","Java") a.showData() a.payment()
Name is Raj Rathi City is Nagpur Salary is 45500 Advance is 5000 Languages (C, C++, Java) Payment is 40500